import watermark from '../../common/watermark.js';

(function (window, document, $) {
    
    $(function () {
        $('body').attr('data-weui-theme', 'light'); //强制光明模式

        _initCommand();
        _returnMain();// 返回首页
        _watermarkBgImg();// 添加水印信息

    });

    //TODO : 命名初始化
    const _initCommand = () => {
        // 生物安全审查
        $('#addPerInPlan').on('click', function (e) {
            window.sessionStorage.removeItem("getMainMessage");
            window.sessionStorage.removeItem("getEntryInfo");
            location.href = `../biosafety/addsaveauditmain.html?v=${Utils.GetTime()}`;
        });

        // 千点评分审查
        $('#addCarInPlan').on('click', function (e) {
            window.sessionStorage.removeItem("getMainMessage");
            window.sessionStorage.removeItem("getEntryInfo");
            location.href = `../biosafety/addthouauditmain.html?v=${Utils.GetTime()}`;
        });
        
    }

    //返回首页
    const _returnMain = () => {
        $('#returnMain').on('click', function () {
            location.href = '../../main.html'
        });
    }

    // 添加水印信息
    const _watermarkBgImg = () => {
        let _userInfo = JSON.parse(Utils.GetSessionStorage("SNAccountEply")) || {};
        watermark.set(_userInfo.name + _userInfo.numCode);// 水印
    }
})(window, document, jQuery)